﻿

namespace EveKillboard.Core
{
    using System;
    using Base;
    using System.ComponentModel.DataAnnotations;

    [Table("ItemGroups")]
    public class ItemGroup : ItemGroupBase, IComparable
    {
        [Key]
        [Column("ID")]
        public override Int16 Id { get; set; }
        [Column("Name")]
        [StringLength(200)]
        public override string Name { get; set; }
        [Column("CategoryID")]
        public Int16 CategoryId { get; set; }

        public virtual ItemGroupCategory Category { get; set; }

        public override string ToString()
        {
            return Name;
        }

        public int CompareTo(object obj)
        {
            return obj is ItemGroup ? ((ItemGroup) obj).Id.CompareTo(Id) : 0;
        }
    }
}